home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 60 / IOPROG_60.ISO / soft / c++ / gsl-1.1.1-setup.exe / {app} / src / integration / qk21.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-12-09  |  2.7 KB  |  78 lines

  1. /* integration/qk21.c
  2.  * 
  3.  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Brian Gough
  4.  * 
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or (at
  8.  * your option) any later version.
  9.  * 
  10.  * This program is distributed in the hope that it will be useful, but
  11.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * General Public License for more details.
  14.  * 
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. #include <config.h>
  21. #include <gsl/gsl_integration.h>
  22.  
  23. /* Gauss quadrature weights and kronrod quadrature abscissae and
  24.    weights as evaluated with 80 decimal digit arithmetic by
  25.    L. W. Fullerton, Bell Labs, Nov. 1981. */
  26.  
  27. static const double xgk[11] =    /* abscissae of the 21-point kronrod rule */
  28. {
  29.   0.995657163025808080735527280689003,
  30.   0.973906528517171720077964012084452,
  31.   0.930157491355708226001207180059508,
  32.   0.865063366688984510732096688423493,
  33.   0.780817726586416897063717578345042,
  34.   0.679409568299024406234327365114874,
  35.   0.562757134668604683339000099272694,
  36.   0.433395394129247190799265943165784,
  37.   0.294392862701460198131126603103866,
  38.   0.148874338981631210884826001129720,
  39.   0.000000000000000000000000000000000
  40. };
  41.  
  42. /* xgk[1], xgk[3], ... abscissae of the 10-point gauss rule. 
  43.    xgk[0], xgk[2], ... abscissae to optimally extend the 10-point gauss rule */
  44.  
  45. static const double wg[5] =    /* weights of the 10-point gauss rule */
  46. {
  47.   0.066671344308688137593568809893332,
  48.   0.149451349150580593145776339657697,
  49.   0.219086362515982043995534934228163,
  50.   0.269266719309996355091226921569469,
  51.   0.295524224714752870173892994651338
  52. };
  53.  
  54. static const double wgk[11] =    /* weights of the 21-point kronrod rule */
  55. {
  56.   0.011694638867371874278064396062192,
  57.   0.032558162307964727478818972459390,
  58.   0.054755896574351996031381300244580,
  59.   0.075039674810919952767043140916190,
  60.   0.093125454583697605535065465083366,
  61.   0.109387158802297641899210590325805,
  62.   0.123491976262065851077958109831074,
  63.   0.134709217311473325928054001771707,
  64.   0.142775938577060080797094273138717,
  65.   0.147739104901338491374841515972068,
  66.   0.149445554002916905664936468389821
  67. };
  68.  
  69.  
  70. void
  71. gsl_integration_qk21 (const gsl_function * f, double a, double b,
  72.               double *result, double *abserr,
  73.               double *resabs, double *resasc)
  74. {
  75.   double fv1[11], fv2[11];
  76.   gsl_integration_qk (11, xgk, wg, wgk, fv1, fv2, f, a, b, result, abserr, resabs, resasc);
  77. }
  78.